package com.cardgame.model.level;

import lombok.Getter;
import lombok.Setter;

import java.util.Map;

@Setter
@Getter
public class LevelInfo {
    // Getters and Setters
    private int levelNumber;
    private String name;
    private String description;
    private int enemyDeckId;
    private int rewardGold;
    private int rewardExp;
    private String backgroundImage;
    private String bossImage;

    public static LevelInfo valueOf(Map<String, Object> levelMap) {
        LevelInfo levelInfo = new LevelInfo();
        levelInfo.setLevelNumber((Integer) levelMap.get("levelNumber"));
        levelInfo.setName((String) levelMap.get("name"));
        levelInfo.setDescription((String) levelMap.get("description"));
        levelInfo.setEnemyDeckId((Integer) levelMap.get("enemyDeckId"));
        levelInfo.setRewardGold((Integer) levelMap.get("rewardGold"));
        levelInfo.setRewardExp((Integer) levelMap.get("rewardExp"));
        levelInfo.setBackgroundImage((String) levelMap.get("backgroundImage"));
        levelInfo.setBossImage((String) levelMap.get("bossImage"));
        return levelInfo;
    }

    @Override
    public String toString() {
        return "LevelInfo{" +
                "levelNumber=" + levelNumber +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", enemyDeckId=" + enemyDeckId +
                ", rewardGold=" + rewardGold +
                ", rewardExp=" + rewardExp +
                ", backgroundImage='" + backgroundImage + '\'' +
                ", bossImage='" + bossImage + '\'' +
                '}';
    }
}